'\" te
.\"  Copyright (c) 2001 by Sun Microsystems, Inc.  All rights reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH RSM_MEMSEG_IMPORT_SET_MODE 3RSM "August 29, 2021"
.SH NAME
rsm_memseg_import_set_mode, rsm_memseg_import_get_mode \- set or get mode for
barrier scoping
.SH SYNOPSIS
.nf
cc [ \fIflag\fR... ] \fIfile\fR... -lrsm [ \fIlibrary\fR... ]
#include <rsmapi.h>

\fBint\fR \fBrsm_memseg_import_set_mode\fR(\fBrsm_memseg_import_handle_t\fR \fImemseg\fR,
     \fBrsm_barrier_mode_t\fR \fImode\fR);
.fi

.LP
.nf
\fBint\fR \fBrsm_memseg_import_get_mode\fR(\fBrsm_memseg_import_handle_t\fR \fImemseg\fR,
     \fBrsm_barrier_mode_t *\fR\fImode\fR);
.fi

.SH DESCRIPTION
The  \fBrsm_memseg_import_set_mode()\fR function provides support for optional
explicit barrier scoping in the functions described on the
\fBrsm_memseg_import_get\fR(3RSM) and \fBrsm_memseg_import_put\fR(3RSM) manual
pages. The two valid barrier modes are \fBRSM_BARRIER_MODE_EXPLICIT\fR and
\fBRSM_BARRIER_MODE_IMPLICIT\fR. By default, the barrier mode is set to
\fBRSM_BARRIER_MODE_IMPLICIT\fR. When the mode is
\fBRSM_BARRIER_MODE_IMPLICIT\fR, an implicit barrier open and barrier close is
applied to the put operation. Irrespective of the mode set, the barrier must be
initialized using the  \fBrsm_memseg_import_init_barrier\fR(3RSM) function
before any barrier operations, either implicit or explicit, are used.
.sp
.LP
The \fBrsm_memseg_import_get_mode()\fR function obtains the current value of
the mode used for barrier scoping in put functions.
.SH RETURN VALUES
Upon successful completion, these functions return 0. Otherwise, an error value
is returned to indicate the error.
.SH ERRORS
The \fBrsm_memseg_import_set_mode()\fR and \fBrsm_memseg_import_get_mode()\fR
functions can return the following errors:
.sp
.ne 2
.na
\fB\fBRSMERR_BAD_SEG_HNDL\fR \fR
.ad
.RS 24n
Invalid segment handle.
.RE

.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Evolving
_
MT-Level	MT-Safe
.TE

.SH SEE ALSO
.BR rsm_memseg_import_get (3RSM),
.BR rsm_memseg_import_init_barrier (3RSM),
.BR rsm_memseg_import_put (3RSM),
.BR attributes (7)
